package com.example.design.bilibili.builder.pattern;

public class HourseDirector {

    HourseBuilder hourseBuilder = null;

    //构造器传入 houseBuilder
    public HourseDirector(HourseBuilder hourseBuilder) {
        this.hourseBuilder = hourseBuilder;
    }


    //通过 setter 传入hourseBuilder
    public void setHourseBuilder(HourseBuilder hourseBuilder) {
        this.hourseBuilder = hourseBuilder;
    }

    //如何建造房子的流程，交给指挥者
    public Hourse constructHourse(){
        hourseBuilder.buildBasic();
        hourseBuilder.buildWalls();
        hourseBuilder.roofed();
        return hourseBuilder.buildHourse();
    }
}
